﻿@model IEnumerable<TraceData> 
@{
        
    Ajax.Dna().Grid(Model)
        .Columns(cols =>
        {
            cols.Bound(m => m.Category).Template(@<text>
    @{
        var imgUrl = "~/content/images/{0}";
        if (item.IsError)
        {
            imgUrl = string.Format(imgUrl, "icon_stop.gif");
        }
        else
        {
            if (item.IsWarn)
            {
                imgUrl = string.Format(imgUrl, "icon_warning_16.png");
            }
            else
            {
                imgUrl = string.Format(imgUrl, "icon_info_16.png");
            }
        }
    }
    <img src="@Url.Content(imgUrl)" alt="" /><span>@item.Category</span>
    </text>).Width(100).Title(Html.Global("RES_TYPE"));
            cols.Bound(m => m.Time).Width(150).Title(Html.Global("RES_LOG_TIME"));
            cols.Bound(m => m.Message).Title(Html.Global("RES_MESSAGE")).Template(@<text>
    @item.Message
    </text>);
        })
        .DetailView(@<text>
    @if (item.IsError)
    {
        <div>@item.ErrorInfo.Message</div>
        <div>
            @Html.Global("RES_SOURCE"):@item.ErrorInfo.Source</div>
        <div>
            @Html.Global("RES_DATA"):@item.ErrorInfo.Data</div>
        <div>
            @Html.Global("RES_STACKTRACE"):</div>
        <div style="white-space: normal">@item.ErrorInfo.StackTrace</div>
    }
    </text>)
        .Render();
}
